<template>
  <!-- 右边 -->
  <div class="order-right">
    <div class="order-content">
      <div class="title">
        <a>我的唯品会</a>
        <i>></i>
        订单管理
      </div>
      <div class="chosetype">
        <div class="warning">
          <i class="iconfont icon-tongzhi" style="color: #0590f1"></i>
          <div class="warning-right">
            <p>
              安全提醒：唯品会不会以任何理由要求您提供银行卡信息或支付额外费用，请谨防钓鱼链接或诈骗电话。
            </p>
            <p>*为保障您的信息安全，订单信息中的联系电话已被加密隐藏。</p>
          </div>
        </div>
      </div>
      <!-- 头部导航 -->
      <div class="order-nav">
        <ul class="order-ul">
          <li>
            全部订单
            <div></div>
          </li>
          <li>待付款</li>
          <li>待发货</li>
          <li>待收货</li>
          <li>已完成</li>
        </ul>
      </div>
      <div class="chosetype-list">
        <table>
          <thead class="header-w">
            <tr>
              <th width="40%">商品</th>
              <th width="31%">订单总额</th>
              <th width="13%">订单状态</th>
              <th>操作</th>
            </tr>
          </thead>
        </table>
      </div>
      <div class="orders">
        <!-- <table class="order-item">
                    <thead>
                        <tr>
                            <th colspan="5">
                                <span class="ordertitle">2017-02-11 11:59订单编号:522553622<span
                                        class="pull-right delete"><img src="./images/delete.png"></span></span>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="goods, index in order.orderDetailList" :key="goods.id">
                            <td width="60%">
                                <div class="typographic">
                                    <img style="width:100px" :src="goods.imgUrl">
                                    <a href="#" class="block-text">{{ goods.skuName }}</a>
                                    <span>x{{ goods.skuNum }}</span>
                                    <a href="#" class="service">售后申请</a>
                                </div>
                            </td>
                            <td :rowspan="order.orderDetailList.length" width="8%" class="center" v-if="index === 0">{{
                                    order.consignee
                            }}</td>
                            <td :rowspan="order.orderDetailList.length" width="13%" class="center" v-if="index === 0">
                                <ul class="unstyled">
                                    <li>总金额¥{{ order.totalAmount }}.00</li>
                                    <li>在线支付</li>

                                </ul>
                            </td>
                            <td :rowspan="order.orderDetailList.length" width="8%" class="center" v-if="index === 0">
                                <a>
                                    {{ order.orderStatusName }}
                                </a>
                            </td>
                            <td :rowspan="order.orderDetailList.length" width="13%" class="center" v-if="index === 0">
                                <ul class="unstyled">
                                    <li>
                                        <a href="mycomment.html" target="_blank">评价|晒单</a>
                                    </li>

                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table> -->

        <table
          class="order-item"
          v-for="(order, index) in orderList"
          :key="index"
        >
          <thead class="order-hea">
            <tr>
              <th colspan="5">
                <span class="ordertitle"
                  >订单编号：{{ order.productId }}
                  <span>{{ order.title }}</span>
                  <span class="pull-right delete">{{
                    order.payTime
                  }}</span></span
                >
              </th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td width="40%">
                <div class="typographic">
                  <img :src="order.imgUrl" />
                  <a href="#" class="block-text">{{ order.name }}</a>
                  <span>x{{ order.num }}</span>
                  <a href="#" class="service">售后申请</a>
                </div>
              </td>
              <td rowspan="2" width="20%" class="center">
                <ul class="unstyled">
                  <li>总金额{{ order.priceExcludePms }}</li>
                  <li>在线支付</li>
                </ul>
              </td>
              <td rowspan="2" width="15%" class="center">
                <a href="#" class="btn">{{ order.payAll }} </a>
              </td>
              <td rowspan="2" width="13%" class="center">
                <ul class="unstyled">
                  <li>
                    <a href="mycomment.html" target="_blank">评价|晒单</a>
                  </li>
                </ul>
              </td>
            </tr>
            <tr>
              <!-- <td width="50%">
                <div class="typographic">
                  <img src="./images/goods.png" />
                  <a href="#" class="block-text"
                    >包邮 正品玛姬儿压缩面膜无纺布纸膜100粒 送泡瓶面膜刷喷瓶
                    新款</a
                  >
                  <span>x1</span>
                  <a href="#" class="service">售后申请</a>
                </div>
              </td> -->
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <!-- <Pagination
      :total="total"
      :pageNo="pageNo"
      :continues="5"
      :pageSize="pageSize"
      @searchOfPage="searchOfPage"
    >
    </Pagination> -->
    <!--猜你喜欢-->
    <!-- <div class="like">
      <h4 class="kt">猜你喜欢</h4>
      <ul class="like-list">
        <li class="likeItem">
          <div class="p-img">
            <img src="./images/itemlike01.png" />
          </div>
          <div class="attr">
            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
          </div>
          <div class="price">
            <em>¥</em>
            <i>3699.00</i>
          </div>
          <div class="commit">已有6人评价</div>
        </li>
        <li class="likeItem">
          <div class="p-img">
            <img src="./images/itemlike02.png" />
          </div>
          <div class="attr">Apple苹果iPhone 6s/6s Plus 16G 64G 128G</div>
          <div class="price">
            <em>¥</em>
            <i>4388.00</i>
          </div>
          <div class="commit">已有700人评价</div>
        </li>
        <li class="likeItem">
          <div class="p-img">
            <img src="./images/itemlike03.png" />
          </div>
          <div class="attr">DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</div>
          <div class="price">
            <em>¥</em>
            <i>4088.00</i>
          </div>
          <div class="commit">已有700人评价</div>
        </li>
        <li class="likeItem">
          <div class="p-img">
            <img src="./images/itemlike04.png" />
          </div>
          <div class="attr">DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</div>
          <div class="price">
            <em>¥</em>
            <i>4088.00</i>
          </div>
          <div class="commit">已有700人评价</div>
        </li>
      </ul>
    </div> -->
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "OrderDetail",
  mounted() {
    this.getOrderList();
  },
  methods: {
    getOrderList() {
      this.$store.dispatch("getOrderList");
    },
    // moveIn(event) {
    //   console.log(event.target.dataset);
    // },
  },
  computed: {
    ...mapState({
      orderList: (state) => state.myorder.orderList,
    }),
  },
};
</script>

<style lang="less" scoped>
.order-right {
  float: right;
  width: 89.33%;

  //订单部分
  .order-content {
    margin: 0 20px;
    // color: #666;

    //标题
    .title {
      margin-bottom: 22px;
      //   border: 1px solid #ddd;
      font-size: 14px;
      border-left: 2px solid #f10582;

      a {
        padding: 12px 10px;
        font-size: 14px;
        // background-color: #f1f1f1;
      }
      i {
        margin-left: -5px;
      }
    }

    //表头
    .chosetype {
      margin-bottom: 15px;
      color: #666;

      .warning {
        background-color: white;
        overflow: hidden;
        padding: 25px;
        font-size: 15px;
        i {
          margin-left: 10px;
        }
        .warning-right {
          float: right;
          margin-right: 200px;
          p {
            margin-top: 5px;
          }
        }
      }
    }

    // 头部导航
    .order-nav {
      font-size: 18px;
      //   background-color: white;
      overflow: hidden;
      text-align: center;
      color: #666;
      padding-bottom: 10px;
      border-bottom: 1px solid #d0d0d0;
      li {
        float: left;
        width: 120px;
        border-right: 1px solid #d0d0d0;
        position: relative;
        &:hover {
          color: #f10180;
          font-weight: 700;
        }
        div {
          position: absolute;
          top: 30px;
          width: 120px;
          height: 3px;
          background-color: #f10180;
        }
      }
    }
    // 表单列表
    .chosetype-list {
      //   margin-bottom: 15px;
      margin-top: 20px;
      color: #666;
      background-color: white;

      table {
        border: 1px solid #e6e6e6;
        // background-color: white;
        border-collapse: separate;
        border-radius: 2px;
        width: 100%;
        max-width: 100%;
        border-spacing: 0;

        .header-w {
          th {
            text-align: center;
          }
        }

        th {
          padding: 6px 8px;
          color: #666;
          font-weight: 700;
          vertical-align: bottom;
          background-color: #f4f4f4;
          line-height: 35px;
          border-bottom: 1px solid #e6e6e6;
          font-size: 12px;
          text-align: left;
        }
      }
    }

    // 表单内容
    .orders {
      font-size: 12px;
      margin-top: 20px;
      background-color: #fffcfc;

      a {
        &:hover {
          color: #4cb9fc;
        }
      }

      table {
        border: 1px solid #e6e6e6;
        border-collapse: collapse;
        border-radius: 2px;
        width: 100%;
        margin-bottom: 18px;
        max-width: 100%;

        th {
          padding: 6px 8px;
          line-height: 20px;
          text-align: left;
          vertical-align: bottom;
          //   background-color: #f4f4f4;
          font-size: 13px;
          color: #666;

          .ordertitle {
            margin-left: 20px;
          }

          .pull-right {
            float: right;
            cursor: pointer;

            img {
              margin-right: 10px;
              vertical-align: middle;
            }
          }
        }

        td {
          font-size: 12px;
          color: #666;
          padding: 6px 8px;
          line-height: 18px;
          text-align: left;
          vertical-align: middle;
          border: 1px solid #e6e6e6;

          &.center {
            text-align: center;
          }

          .typographic {
            img {
              float: left;
              width: 100px;
              height: 100px;
              margin-right: 10px;
            }

            a {
              float: left;
              min-width: 80px;
              max-width: 200px;
              color: #e1251b;

              &.service {
                color: #666;
              }
            }

            span {
              float: left;
              min-width: 80px;
              max-width: 250px;
              text-align: center;
            }
          }
        }
      }
    }

    // 分页
    .choose-order {
      .pagination {
        margin: 38px 0;

        ul {
          font-size: 0;
          display: inline-block;

          li {
            display: inline-block;
            padding: 4px 9px;
            font-size: 14px;
            border: 1px solid #e0e9ee;

            &.prev,
            &.next {
              background-color: #fafafa;
            }

            &.prev {
              border-right-color: #28a3ef;
            }

            &.page {
              border-color: #28a3ef;
              border-left: 0;

              &.actived {
                background-color: #28a3ef;

                a {
                  color: #fff;
                }
              }
            }
          }
        }

        div {
          display: inline-block;
          font-size: 14px;
          color: #333;
        }
      }
    }
  }
}
</style>
